//
//  main.m
//  first class
//
//  Created by 李尹卓 on 16/4/5.
//  Copyright © 2016年 李尹卓. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Atom.h"
#import "Person.h"
#import "Mouse.h"

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        // insert code here...
        NSLog(@"Hello, World!");
        Animal *ani = [[Animal alloc] init];
        ani.name = @"动物类";
        
        Person *p = [[Person alloc] init];
        p.name = @"程泽";
        
        Mouse *m = [[Mouse alloc] init];
        m.name = @"蔵鼠";
        
        NSArray *arr = @[ani, p, m];
        NSLog(@"names: %@", [arr componentsJoinedByString:@","]);
        
        NSString *str = @"史蒂夫,圣诞快乐,🔚,艾薇儿";
        NSArray *ano = [str componentsSeparatedByString:@","];
        ano = [ano sortedArrayUsingSelector:@selector(compare:)];
        for (int i = 0; i < ano.count; i++) {
            NSString *s = ano[i];
            NSLog(@"%d..%@", i, s);
        }
        
        NSArray *numbers = @[@(13397334528), @(18173382186), @(15273324634), @(14773233729)];
        numbers = [numbers sortedArrayUsingSelector:@selector(compare:)];
        for (int i = 0; i < numbers.count; i++) {
            NSNumber *s = numbers[i];
            NSLog(@"%d. %@", i, s);
        }
    }
    return 0;
}



